package com.nf.service;

import com.nf.entity.ResponseData;
import com.nf.entity.WeatherMessage;
import com.nf.entity.WeatherOtherInfo;

public class WeatherServiceImpl implements WeatherService {
    public WeatherMessage getMessage() {
        WeatherOtherInfo yesterday = new WeatherOtherInfo();
        yesterday.setDate("28日星期五");
        yesterday.setType("多云");

        WeatherOtherInfo forecast1 = new WeatherOtherInfo();
        forecast1.setDate("30日星期天");
        forecast1.setType("晴天");

        WeatherOtherInfo forecast2 = new WeatherOtherInfo();
        forecast2.setDate("31日星期一");
        forecast2.setType("晴天");

        ResponseData data = new ResponseData();

        data.setShidu("72%");
        data.setPm25(42);
        data.setPm10(68);
        data.setQuality("良");
        data.setWendu("27");
        data.setGanmao("极少数敏感人群应减少户外活动");
        data.setYesterday(yesterday);
        data.getForecast().add(forecast1);
        data.getForecast().add(forecast2);

        WeatherMessage message = new WeatherMessage();
        message.setMessage("程序员你好，成功啦");
        message.setStatus(200);
        message.setData(data);

        message.setTips("注意：当前API仅仅是模拟测试用");
        message.setDate("20180928");
        message.setCount(2);
        return message;
    }
}
